DECLARE FUNCTION revhex$ (value%)
OPEN "c:\romhack\FS2Kanji.txt" FOR INPUT AS #1
OPEN "c:\romhack\FS2Kanji.tbl" FOR OUTPUT AS #2

 valu% = &H100

DO
  LINE INPUT #1, tex$
  '
  IF tex$ = "" THEN
    GOTO Continue
  END IF
  '
  '
  FOR c = 1 TO 16 STEP 2
   PRINT #2, revhex$(valu%); "="; MID$(tex$, c, 2)
   valu% = valu% + 1
  NEXT c
  '
Continue:
LOOP UNTIL EOF(1)
CLOSE

FUNCTION revhex$ (value%)

hexx$ = STRING$(4 - LEN(HEX$(value%)), "0") + HEX$(value%)
revhex$ = MID$(hexx$, 3, 2) + MID$(hexx$, 1, 2)
END FUNCTION

